package bbkj.org.cn.controller;

import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RestController;

import bbkj.org.cn.service.DynamicDemoService;
import bbkj.org.cn.service.MockDemoService;
import bbkj.org.cn.service.RestDemoService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;

@RestController
@Slf4j
public class DubboController {
	
	@DubboReference
	private DynamicDemoService dynamicDemo;
	@DubboReference
	private MockDemoService mockDemo;
	@DubboReference
	private RestDemoService restDemoService;
	
	@GetMapping("/test")
	@ApiOperation(value = "/test", notes = "CC")
	public String get() {
		log.info("get 方法");
		restDemoService.get();
		return "OK";
	}
	@PostMapping("/test")
	public String post() {
		log.info("post 方法");
		restDemoService.post();
		return "OK";
	}
	@PutMapping("/test")
	public String put() {
		log.info("put 方法");
		restDemoService.put();
		return "OK";
	}
	@DeleteMapping("/test")
	public String delete() {
		log.info("delete 方法");
		restDemoService.delete();
		return "OK";
	}
}
